Post

Replies

Boosts

Views

Activity

Reply to popoverTips don't display for toolbar menu buttons in iOS 26.1
This is the workaround that I am currently using, which is just using TipKit's model to drive a popover(). Note that these popovers, in iOS 26, use the iOS 26 LiquidGlass morphing-button popover style. import SwiftUI import TipKit extension View { func popoverTipWorkaround(_ tip: some Tip) -> some View { modifier(PopoverTipWorkaround(tip: tip)) } } private struct PopoverTipWorkaround<T: Tip>: ViewModifier { let tip: T @State private var shouldDisplay = false func body(content: Content) -> some View { content .popover(isPresented: $shouldDisplay) { TipView(tip) .tipViewStyle(NoDismissTipStyle()) .tipBackground(.clear) .presentationCompactAdaptation(.popover) } .task { for await status in tip.statusUpdates { if status == .available { shouldDisplay = true } } } } } private struct NoDismissTipStyle: TipViewStyle { func makeBody(configuration: Configuration) -> some View { VStack(alignment: .leading) { configuration.title configuration.message } .padding() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
1w
Reply to SwiftData on iOS 18 extreme memory use
@jhokit thank you for this sample project, it was extremely helpful. I worked around SwiftData's Query memory issue using this workaround: https://gist.github.com/juanarzola/dca3c96f1122cb9710e443e40d75b01b The problem is not just when counting, any query will load all the objects. It's a terrible regression, I don't know why it won't get fixed. it's not perfect and just wrote it so it might not have the best naming. Thankfully "willSave" now works so we can write code like this.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’24
Reply to popoverTips don't display for toolbar menu buttons in iOS 26.1
This is the workaround that I am currently using, which is just using TipKit's model to drive a popover(). Note that these popovers, in iOS 26, use the iOS 26 LiquidGlass morphing-button popover style. import SwiftUI import TipKit extension View { func popoverTipWorkaround(_ tip: some Tip) -> some View { modifier(PopoverTipWorkaround(tip: tip)) } } private struct PopoverTipWorkaround<T: Tip>: ViewModifier { let tip: T @State private var shouldDisplay = false func body(content: Content) -> some View { content .popover(isPresented: $shouldDisplay) { TipView(tip) .tipViewStyle(NoDismissTipStyle()) .tipBackground(.clear) .presentationCompactAdaptation(.popover) } .task { for await status in tip.statusUpdates { if status == .available { shouldDisplay = true } } } } } private struct NoDismissTipStyle: TipViewStyle { func makeBody(configuration: Configuration) -> some View { VStack(alignment: .leading) { configuration.title configuration.message } .padding() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
1w
Reply to SwiftData/ModelCoders.swift:1762: Fatal error: Passed nil for a non-optional keypath
I filed feedback for either this or a similar issue FB15170769 - I reproduced the same Fatal Error but there's no save needed, it happens when a FetchedResultCollection is passed to a SwiftUI List()
Replies
Boosts
Views
Activity
Sep ’24
Reply to SwiftData on iOS 18 extreme memory use
@jhokit thank you for this sample project, it was extremely helpful. I worked around SwiftData's Query memory issue using this workaround: https://gist.github.com/juanarzola/dca3c96f1122cb9710e443e40d75b01b The problem is not just when counting, any query will load all the objects. It's a terrible regression, I don't know why it won't get fixed. it's not perfect and just wrote it so it might not have the best naming. Thankfully "willSave" now works so we can write code like this.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’24